Forgot to uncomment the line that updates rupshistory and after testing fixed a few javascript mistakes.