added support for repeat and shuffle