changed some function names to simplify