added a proper remove function to linkedlist.cpp