add output method, improved value calculations