Edited sample code