Made object oriented version of gol5.cpp