recursive northern function