got rid of messy use of lists