Added several methods. It now correctly does test cases 1-3.