calculations

modified by adding some calculations, but not final yet