base code working