updated for funcionallity on pi