Cleaned up code and paraphrased comments. Properly Modified access to some helper functions