Adding specs and solving bugs