using a different function to replace '}'