add comments, clean code, refatoring