Issue 30: Optimizer routine needs tests

fixes #30 
I really don't know