uploaded complete solution minus one method