Adds working tests and code