added javascript as requested