my way of solving MobiDev test