generalize
initial implementation