added all ids and fixed calculations