rewriting base code