cleaned code
implemented first test for read