added comments, command line parsing