updated lots of these middleware functions
Merge branch 'master' of git://github.com/skeweredlogic/CS490