Converted code to OOP and built basic functionality