main function in fpex.c