more comments, better formatting