shell

refactored slightly