Modified javascript to allow variabel modification