finished implementing the push function