fixed $.each functions + improved $.require