Fixing my previous mess; insertions must be within boundaries
doing it right