code developed while taking game theory class (class did not require/request coding so think ok to share)