add comment & clean up source code