added handling and resolving collisions