moved javascript to a seperate file