How can I generalize pendulumManagement() to take as arguments the names of the functions to fire and the boolean to decide on? I\'m using java and processing library.