Optimized a few things and did some formatting