function reorganization for optimization
reorganized and optimized indexing functions
added explicit function to seed random numbers
added functionality for calculation without weights
added function to remove float rounding errors in parameter ranges