slight tweak to check boundary lines