todo add working well, about to refactor to allow editing