added capsule card calculation and ui