Added view functions and tests