in between change
added some structure to the code.