finished functionality -- need to add file I/O