Have to implement connectedComponents function that works as wanted. Was trying to do it, but it was VERY inneficient...