cleaned code and removed error causing statement