changed output from double to int, reduces file size