edited parsing for more advanced features, added switch to handle commands