Persistant problems with buffor in prompt function. Resolved memory allocation problem