Slight cleaning up and added comments