New version

Added escape key and added settings for R and cleaned code.