add backspace functionality to literal input
add calculate register
improve the mode transition logic