added FLAC3D mode and some general functions