implements first method and last method