algorithm reduced :)