fix bug in grahamscan