cleaning up determineKeyLength and adding determineKey