Update main lib

Add a switch for OS selection