fix lines calculation
fix wall checks