some minor functions added.