Changed functions so they're no longer anonymous