lists algorithm
not working yet