Code cleanup and added flexibility

updated readme