Fixed issue with scope add. Cleaned up JS and example