Adding in a new function, and some tweaks