Code cleaned.v 1.3 ready to publish