Added options for gravity so that it goes in the horizontal and vertical