Cleaned and reformatted code