Cleaned up code, finished documentation, added hard fix for memory allocation issue in loadTracePINSsim()