written a large part of documentation and added a template mainpage