fix some code warnings
more comments