Fixed Windows sleep fuction, added a read fuction, and did some clean up.