replaced getch with wgetch