big bugs and mistakes fixed