adding tests for calculating ranges. almost works, randomly fails