Updated for working code