included some simpler residuals and tidied up femscheme a little.