changed calc implementation to not use polish notation