improved filename->killring function