Some corrections to function names and removed unneeded code