updated function names
improved bias handling