finding boundary part already gives segmentation fault = =