Added a sanity check an more clarifying comments