Modifying some jQuery for smoother transitions