ajusted to codestandards (mostly)