added sams code for following