[HL] file reading and collision code