Organized the code