Added main classes. Implemented printing out solutions