add get_metadata method which returns line number and line index.