write base code