add algrorithm to remove space in string