Can you tidy the code ?