merged the codes from the guy with nice interface to the one who had access tokens