added condition to number if not already numbered

Made changes to number if not already numbered . added test to check it too .