tested q, removed factorial code snippet