Added function for finding extrems
Added extrems plot for finding clusters