finished copying sample code