added code for multiple characters