New internal function added and 3 other functions amended.