Fixed implementation of list