added surrounding algo
changed some surrounding algo stuff
merged to master