cleaned code and comments