added doc strings, reorganized