converted code-style to my own