added more export and bug fixes