Sample code but unable to execute