initial commit, builds but segfaults.

TODO: fix