algorithm modification