Added assertion.
  Simplified return-logic.
 Added assertions.
  Added assertions & limits.