Add main functions and mutex and playlist functions