fixed bugs in peak detection.. grid > 1 still bugged