setup basecode.