refactor sudoko solver and add test cases