adds docs, adds scan algorythm