Tried to write train method