simplfied and cleaned up the sample