added auth code, needs testing