Changed the dims variable to an int