add comments, cleanup, add listdir()