Added function signatures (That's what they're called right?), and fixed a few problems to my liking