WIP implementation with defs
All tests are passed now