modified and corrected some code mistakes for text to keyboard, still has some mistakes