Almost done reworking, working out bugs.