simplyfied code