Made program more OO