removed a big block of commented code
Fixed some bugs and updated tests