Added createDirectory function