Removed dead code and did some formatting.