major changes. moved all functions into a class. still need to do something with display func.