Algorigthm for trimming whitespaces has been completely changed