tidy up. not working in command line