added a working version of the hill function