Structure and stability of two dimensional phosphorene with O or NH functionalization