Removed a duplicate function
Added an assertion to prevent underfitting
Harmonized whitespace (tabs to spaces)