semplified, organized and commented