Cleaned up code to use common method

created common dice method and added comments