Sorted lists iteration 3 (implement the rest)

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>