Altered js for mobile support 