Added command line arguments, cleaned up code