cleaned up PHP slightly