Testcode, fixed implementation