aha! was misusing the min function.