fixed calculation of materials in position form