Modified, thanks to @mattn_jp