Actually update code to what was finished over summer

Last update was incomplete + buggy code