added permalinks and fixed some small bugs
fixed lots of formatting