Fixed contains method and added test code.