Added keyboard input function