db updated
moved js code into a seperate file