moved includes to top for better visability
rewrote authorization routines
fixed standard authorization