attempt at adding functionality to procedure