Tidied the code, reordered to be more logical and added comments describing functionality
Tidied the code, reordered to be more logical and added comments describing functionality

tashaharrison/lmpag,tashaharrison/lmpag,tashaharrison/lmpag