huge update, many fixes