html and php cleanup, improving queries.