implement various ways of computing F