changes to jquery calls and clean up