Compiling version of collision algorithm

Not tested!!