added fpie function