removed some commented and unused code as suggested