Changed Java to JavaScript