Added JavaDoc style documentation to all code, tidied up code and finalized with latest requirements