Keeping track of the currently selected element