pulled out javascript to seperate file