rewrote loop to better process posts

also cleaned up ui