[MaestroApp]: improved pins algorithm