added takeAction function

doesn't validate and I guess I should test it at some point.