moved code into main