procedures added, functions improved.