some docs + not spurious printing
moving algorithms to another file