a quick ga implementation