working version. don't bother with local files for now'