Wrote database code for hpoints