fixed calculations with 3 arguments and getting result