some functional changes, some documentation