Added document.ready and added whitespaces for readability