adding prepare statements; small insert fixes