ToDouble() returns a double, and minsToKeep is an int, so this causes a compiler error. Perhaps you also meant to change the minsToKeep variable to a double?