improved plotting and added keyboard option