Refactored makeLongkey to match output in python version.