create method to create an object out of a row