style changed

Changed to a more OOP approach instead of functional.