ios stack calculator from Stanford Course 2011