Started working on sample_bounds. Added math functions