Cleaned up the code a bit and made the index and new post pages work