updated function. thanks, isaac
version