Added new functions: getSelected, select next, select prev.