add scanning functions
scan functions tested
add inbounds in scan functions