bae sample code