generally finished, requires optimization