cleaned code, fixed formatting issues