moved some code around
good enough to get some feedback I think
slightly improved the access denied page