Re-implemented giving rewards using new algorithm - Pending Testing