corrected Update_spw_ipsps and started a bit cleaning the code
In progress of cleaning up the code. Just corrected
calculate_max_in_given_patch
corrected/cleaned up until update_spws_beg