played around with optimization