Condense base case in 'put' function.