rewritten everything in class - easier to use