wrote JS to handle haiku cycling