Added calculator logic and some minor changes