implemented sleeping, reading, writing in application 3a