mas mierda

almost donne, last checks remanining. Also some parts need optimization