Fixed action order. Placed some variables.