adding code and write up for tests