added lots of documentation