remove shitty hack by using ranges