completed implementation for insert statements