Update 070414

Optimised some of the code and added functionality