updated more sample code