add copy function
add solver class
add reduce function