Fixed dir, half-assed some more code; not right yet