finish implementing and testing function