I think you can change it to for(var/atom/movable/A in range) and remove the next two checks