working version + scratch