cleaned code with astyle