moved repeated code to new function wallsInRadius