finished impl - still some rough edges