Added flakePosition to pure JS Version