updated code to match other functions