collision handling rewritten to linq