Gfanlib

fixed one minor bug and added some features requested by andreas gathmann