save work
switched from out parameters to return values
speed improvements