change transition duration from 300ms to 400ms
adjust code structure, fix some bugs