finished 385 authorization from scratch part1