Removing var completely as return var width caused other problems.