ported x11, added PI-definition, otherwise the same