clearified assignment function
moved some variables to more apropriate areas
fixed double back after auto-correct bug