Added the code to delete the smallest node