removed chunks of commented code and unused functions.