fixed comments and cleaned code