tighten up code added playlist support