re-named variables for nicer reading. it works
separated big method into smaller methods (single responsibility rule)