Most of the work

TODO: change header names. Complete check.