optimization + a lot more

doubt that it is ever going to work(