corrected some mistakes, tests updated