squared weight function for greater good