Cleaned up a bit
Restructured insert() method, added more comments