added arrays for s and b