updates
Major update to authorize function