fixed several math bugs and cleaned up code for hard and soft EM experiments