Added formatted strings to expand function