Removed function #4, subfunctions 4.1,4.2,4.3. Was causing issues, will redefine a similar function that has more granularity