Completly rewritten for simple code. Easily to use for any dia / pages