cleaned code. added proper comments. finished and closing