switched to jQuery animate instead of long algorythm