Riot.js version, very messy, confused and incomplete