Edited reward function somewhat