Made my code a little less system dependent