Would like a resource for deeper math that explain why this work otherwise it looks like magic.