moved usage code inside of document.ready and definition outside