added code and testing