Implemented logic for read element and added tests.