working commit

Might have some rough edges and not as much error checking, but it's
working.