lua hooks, fixed solution matrix bugs
added saving/loading