updated to use php class