modify search magic number function