Started writing up the functions
I should probably tell people that this isn't ready yet..