Cleaned up code and slightly changed layout