rearranged functions to make it look neater, solved the problem of stopping periodic service by using .getService instead of .getBroadcast.

Changed stopPeriodSvc to onClick function instead of listener