updated jqplot & refactored code