adding version with Function