added collision resolution