Moved the checking of H and S after x and Y
Removed the checking of coef in python
checking coef null in python