using applicative functor. first try