ReadDir now uses a switch insted of many if elses