This will be easy... enumerate, select, calculate...
(cloning is a good idea)