two working optimiaztions