working state now (many fixes)