removed keylength as function, and cleaned up example usage in main