factoring num Q's into a function