Main complete, now uses a class object

Testing still needed