Measurements (was #30).

Reading through this function again it seems like having explicit type annotations for the function arguments would be useful.