bugfix basic fiar function
implemented advanced fiar function