Changed implementation to linked lists and added a new delete() function