made changes to prevent race condition in discharge function
Merge branch 'master' of github.com:ksarvesh/eecs587