Refactored eval. Added eval test.