Code cleanup and added better command line help printout