move algorithms to levels