changed to work with different commands