updated to use PHP