improved the get function, and several tests.