Bala's sample codes