first draft of a (bugged) collision resolver