Added OS Check, started code cleanup