complex calculator solution