sample mr and foundation code