writing functions for spotify functionality