updated from jorges repo