loop through newest first, implement updating, better output, cleanup code