Use ARGV for input file

Signed-off-by: Oscar Sanhueza <oscarsanhueza@gmail.com>
deletes debug functions

Signed-off-by: Oscar Sanhueza <oscarsanhueza@gmail.com>
deletes more debug functions

Signed-off-by: Oscar Sanhueza <oscarsanhueza@gmail.com>
Change the function names for something more suitable

Signed-off-by: Oscar Sanhueza <oscarsanhueza@gmail.com>
Add the final calculations

Signed-off-by: Oscar Sanhueza <oscarsanhueza@gmail.com>