some craziness
got insertion working correctly