added code for insert, delete but need to clean up code