Refactored makeSubkeys to match output from python version.