Refactor maxorder, clean up reorder function, remove unused from toggleComplete.