Finish the addEntry() function