Changed everything to javascript