Items are kept in a list by their id's.
Added line intersection code.