Moved javascript to seperate file