Added parameter to invert output