Removed excessive nesting from keyInterrupt function
Improved comments