attempt to improve R prototype... not very convincing