cleaned up a bit and finally got everything working nicely with points stored on the database