improve readability, add some comments