added code to do the full calculations now just need to test it