location graph function fixed