In semi-functional form now, needs some work on certain kinds of configurations