made some changes to avoid factors