Made it work wit test cases