maintain list instead of rebuilding in loop