first iteration of compression implemented