fixed errors and set up class, ready for testing