Added method for finding average period interval. Also added devise gem