Changed api a little bit
changed var names so $ prefixed vars represent jquery objects