Added assertions, style revision