added extended euclidian as well as finished n shares