dupe functions are defined outside onload, button has onclick