some practical codes