Changed intvar to trim functions for checking.