adding line intersection (for wall avoidance, inclusion doubtful) and adding to initialisation code