Learning through mistakes