added a little gravity code