changes to optimise speed