Building out plugin function