Did some cool stuff to lessen code duplication for looping through directories. Also, started working on better grouping.