updated it a bit more, no major changes, just made comments clearer