various changes and new flags