added new algo on linear collision, bugged