modified and moved detector_lib.c

Added more args to represent points. Edited loop code.