lots of docs, and put type sig on main function