Added instruction insertion

Fixed bugs in instruction deletion and added instruction insertion