more documentation
added a -main function