added version check and functions