removed redundant variables

removed `self` and `type` as redundant variables.

used hoisting for declaration of `arg` variable.

used only `push` operation instead 
1. compute length of array
2. find by index
3. assgin operation