added code to strip spaces of a formula expression both at the head and the tail.