Debugging and adjusting. Added bias to penalize a large difference in length between upper and lower halves.