Added handling of keys
Adding command line flags