first attempet at minimization