put this assert at the beginning of the if statement, and remove else branch :) it looks terrible