fixed main code example