implemented extra credit backspace and invert