algorithm modifications