getElement functionality added and test cases corrected