Fixed header, documentation, added preferences.