wrote makeAction and associated functions