i think the problem you are facing is due to the fact that
though for the programmer the values are entered in a sorted way but inside the hash values and their corresponding keys are stored in random sequence so it is very much possible that inside the hash the no 1 key value pair is not at all what you are expecting.