change to object oriented approach

Cleaned up the code by rethinking the approach and creating classes.
Easier to work with objects to keep track of important attributes (i.e.
starting position, row number, column number,)