Tried using functional programming only.