Algorithm questions