Update twenty4.js

Rewrote logic.