my understanding of middleware is...limited. I got frustrated.