cleaned code, comments and indentation