initial implementation. duplicated file