Prettied up the restrict function