Fixed indention and code style, set private functions to public.