started writing algorithm for SDM manuscript