fixed a few issues, and fixed formatting.