functions added, untested