updated js to handle capitals and made some fixes with other browsers