simplified key loop
function for stty settign was not working, put back as it was earlier