updated initial sample code