Cleaned up a few things, corrected insertBefore. Still not able to implement deallocing the temporary pointer memories.