arranging the code