You are not updating your bay variable inside of the loop somewhere. It gets set once and stays the same. You need to recalculate it every time.
www.google.com.tw