added backspace based deletion of words. The code is a mess but I think it works :)