no magic number anymore and fixed wrong calcs