- changed variable names to make it more clear what they do
- corrected linefeeds