added list items function, formatted code