moved main functionality to run()