Modififed jquery script for consolidation