Mostly working.

Most of the required stuff is implemented.