Re-organised the code
modified