All functions written first draft done