finished backend code, but it definitely needs review since it was written so late