changed bracket conversion pesedo code