Improvement : Rearrange the order of the code.