use std.algorithm.find instead of hand written loop