simplifying code
merged with master