Started writing tests, improved inheritance