Rewrote Main method as a console app