trying to write remove function