made class containing open and save functions