Added use of $.extend

Completely changed how data is getting passed through.