runs correctly from command line now