write test and edit code to account for two keys equal to the min value