Removing redundant variables