cleanup, minimum value

I've cleaned up the style a bit and added support for setting minimum value.