add comments and organized header
Reduced compiler warning
add comments and organized header