Initial working commit, ugly as it is.