added calculate function

added calculate function for sysfs