factor longest() & shortest()
resolve merge conflicts