additional functions added, many need debugging.