full (design) working version with cleanup