fixed functions to return values