added test code to comments