Looked at Issue #2

Made up a sample and tested it
Also cleaned up JS file