Completed code for Gravity column