Moved to list monad for less overhead