algorithm finaly done