comments and cleaned code