some basic testing and bug in *f* functions fixed