Theoretical studies of the geometries of O and S overlayers on the (100) surface of nickel