cleaned it up a bit, made variables more clear