added comments & shorter input alternative