add documentation; generalize for all OSes