Much better paramter relationships

I improved the javascript, as well as the internal (PHP) logic