Added invert flag, update to input types