Fixed comments and cleaned code a bit