updated test code to include more comprehensive tests,  and have more readable comments