Issue 30: Optimizer routine needs tests

fixes #30 
Yes that's what I figured as well. Thanks!