improve docs; make coding style consistent