Added more routines and fixed up some old ones