Add comments, refactor