updated prototype code