improved algorithm's data representation