Triangle exercise | 2nd iteration