Update: improved guard clause in main line 70