changing synchronized to atomic, also testing recursive version of contains