writing and fixing tests