changed function names, several other small changes