Cleaned and commented