modified the insert function name and added insertFront function