working on js structure
transition flow