add function for interactive interface with keybord.