Mode Function

Created a mode function