convenience function for initializing library