improved to fit in quartus