added more docs, refactored, included string escape function setup, made variables case-sensitive