fixing bugs on wrong mathematical domain