Add tests and create generate doctes script