added output explaination, mild beautification