slight modification to test code