Implement element info exception handling

Added exception handling for getting element info in main method.
Additionally, fixed computation error.