Revert "moved prying code to a function"

This reverts commit 6eb46f69a4ffb214de954eaa907bfcdb1387b405.
Moved prying to a function (again)

this commit better not bring up any more errors