COMPLETED: The defence section of functions
Lot's of edits thanks to necron.
More discussion and ideas.