reimplemented list and xlist function