modified code to add extra cap sensors