refactored to newer version
updated version