Theoretically implemented everything else.

WILL NEED EXTENSIVE TESTING.