updating code and basic example