added "-" filename capability and getting device from environment