code from last portion of php class