assignment done, deal with unsolvable null pointer, pass all of the test cases