//fixed project function which wasn't working efficiently before