moved main out of constructor into a run method