Preferences added, many improvements