sleek implementation of calculator that incorporates memory of operations