updated code to use NewCaps