Finished modularization code added README. Changes to minimize deadlock.