Just a few small changes.

Scrapped PATCHLEN and set a value for the kernel size.
Also renamed some variables, partly so they have more descriptive/relevant names
and partly for consistency between functions.