my attempt to implement Nim