cleaned up php
tweak to ruby qs