refactor/improve and solve glitch issue
Merge stage three with Justin