added duplication and fixed atomic length