Made the method more felixible with ability to add max number. Also added comment