switch bed intersect to use tempfile instead of a python