Tried different variations in the test program. Seems to work pretty stable. MSE calculations for verification for many runs is still missing.