Rewritten with Bacon.js