added phpdom and functions