improved algorithms and perfomed evaluation tests