added output details
added working sample code