began implementing a reward function