first commit. Code is in a half-working state.