only exposes one function to window, makes second param optional