Improved the javascript, added keys