initialization now done in JavaScript instead of PHP and moved to js file