removed sysouts and recurring insertHead function