Added lots of functions, plus testing