Fixed bug in case 2 and insert function in table 12