Updating to linked lists for better performance