implemented methods to replace in-line variables
fixed error in graphite function