modifed remove method. it works except for being able to remove head.