V0.2: Added a context manager for convenience