use scandir() instead of readdir() in mkplaylists
add comments
code cleanup