fixed indentation and deleted old code