+adding AM/PM detection and updates string values