New gen map

Added new genMap fuction. Fixed a bug in desiredPeak