changed some function names, other minor changes