implement fg and test it a little