added close and isclose
error handling
unused import