small changes to optimization and test code

normalization gone, replaced with user specifiable epsilon values
grid visualization added to test code