js is a bad language for that....