algorithm enhancement