Removed some commented code and unused functions