had variables in wrong position