Adds method for setting gravity