Some functions amended and examples corrected.