new file:   beads.cpp