add more comments and started code cleaning stage