got factor() working