Added solution and test code