adjustment to function, untested due to error with arduino IDE