created inPlaylist function