Added handler for Ctrl+C
Removed dependency on gearadmin
Simplified max calculation