Main code is now working, began work on extending the code to accomodate
more rapid calculations (still WIP)