made indentation more consistent
made code more idiomatic