Code structre changed a little, Page Format option added and minor fixes