added key press 'p' and 'n' to interaction