add some documentation, add forward declarations