finished implementing toppage js