Added modes and prev/next functionality.