varius small corrections
minor bug and style fixes, updated diagram