changing code in lib to have the list in the correct order