Core functionality implemented, first commit.