added a comprehensive test