Added guard clauses/license info and extra documentation