Checking dimensions within class