added better function versions