Added code to support many regression types